function getScore(MyAuswer) {
  let total = 0
  const singleScore = 100 / MyAuswer.length
  MyAuswer.map(item => {
    if (item.myanswer === item.answer) {
      total += singleScore
    }
  })
  return Math.floor(total)
}

function getWrongData(MyAuswer) {
  return MyAuswer.filter(item => {
    if (item.myanswer !== item.answer) {
      item.answer = item['item' + item.answer]
      return true
    }
  })
}
export { getScore, getWrongData }
